import request from '@/utils/request'
// 点位管理

// 获取区域详情
export const getRegionListApi = (params) => {
  return request({
    url: '/api/vm-service/region/search',
    params
  })
}

// 新增区域
export const addRegionListApi = (data) => {
  return request({
    url: '/api/vm-service/region',
    method: 'POST',
    data
  })
}

// 修改区域
export const modifyRegionListApi = (data) => {
  return request({
    url: `/api/vm-service/region/${data.id}`,
    method: 'PUT',
    data
  })
}

// 点位搜索
export const serchNodeListApi = (params) => {
  return request({
    url: '/api/vm-service/node/search',
    params
  })
}

// 获取商圈列表
export const getDistrictListApi = () => {
  return request({
    url: '/api/vm-service/businessType'
  })
}

// 新增点位
export const addPenterListApi = (data) => {
  return request({
    url: '/api/vm-service/node',
    method: 'POST',
    data
  })
}

// 修改点位
export const alterPenterListApi = (data) => {
  return request({
    url: `/api/vm-service/node/${data.id}`,
    method: 'PUT',
    data
  })
}

// 点位详情
export const vmPenterApi = (id) => {
  return request({
    url: `/api/vm-service/node/vmList/${id}`
  })
}

// 合作商搜索
export const getPenterListApi = (params) => {
  return request({
    url: '/api/user-service/partner/search',
    params
  })
}

// 新增合作商
export const addPenterApi = (data) => {
  return request({
    url: '/api/user-service/partner',
    method: 'POST',
    data
  })
}

// 修改合作商
export const alterPenterApi = (data) => {
  return request({
    url: `/api/user-service/partner/${data.id}`,
    method: 'PUT',
    data
  })
}

// 删除合作商
export const delPenterApi = (id) => {
  return request({
    url: `/api/user-service/partner/${id}`,
    method: 'DELETE'
  })
}

// 重置合作商密码
export const servePenterApi = (id) => {
  return request({
    url: `/api/user-service/partner/resetPwd/${id}`,
    method: 'PUT'
  })
}
